package com.ltkj.system.api;

import com.ltkj.common.core.constant.ServiceNameConstants;
import com.ltkj.common.core.domain.R;
import com.ltkj.common.core.web.domain.AjaxResult;
import com.ltkj.system.api.domain.ShopGoodsDTO;
import com.ltkj.system.api.domain.ShopHotelDTO;
import com.ltkj.system.api.domain.ShopRestaurantDTO;
import com.ltkj.system.api.factory.RemoteShopFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 商城服务
 * 
 * @author ruoyi
 */
@FeignClient(contextId = "remoteShopService", value = ServiceNameConstants.SHOP_SERVICE, fallbackFactory = RemoteShopFallbackFactory.class)
public interface RemoteShopService
{
    /**
     * 商品信息查询
     *
     * @param shopGoods 商品信息
     * @return 结果
     */
    @PostMapping(value = "/mobile/goods/listTop")
    public R<List<ShopGoodsDTO>> listGoods(@RequestBody ShopGoodsDTO shopGoods);

    /**
     * 酒店信息查询
     *
     * @param shopHotel 酒店信息
     * @return 结果
     */
    @PostMapping(value = "/mobile/hotel/listTop")
    public R<List<ShopHotelDTO>> listHotel(@RequestBody ShopHotelDTO shopHotel);

    /**
     * 餐饮商户信息查询
     *
     * @param shopRestaurant 餐饮信息
     * @return 结果
     */
    @PostMapping(value = "/mobile/restaurant/listTop")
    public R<List<ShopRestaurantDTO>> listRestaurant(@RequestBody ShopRestaurantDTO shopRestaurant);

    /**
     * 清除指定购物车商品
     * @param goodsIds 商品id
     * @param types 商品规格
     * @param userId 用户id
     * @return
     */
    @DeleteMapping(value = "/mobile/cart/clearCart")
    public AjaxResult deleteCart(@RequestParam("goodsIds") Long[] goodsIds, @RequestParam("types") String[] types, @RequestParam("userId") Long userId);

    /**
     * 清除购物车商品
     * @param ids 商品id
     * @return
     */
    @PostMapping(value = "/cart/deleteByIds")
    public AjaxResult deleteCartByIds(@RequestParam("ids") Long[] ids);

}
